﻿using Wms.Manager.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
using static Wms.Manager.Permissions.WmsPermissions;

namespace Wms.Manager.Permissions;

public class ManagerPermissionDefinitionProvider : PermissionDefinitionProvider
{
    public override void Define(IPermissionDefinitionContext context)
    {
        var wmsGrpup = context.AddGroup(WmsPermissions.GroupName, L($"Permission:{WmsPermissions.GroupName}"));
        var InventoryManagement = wmsGrpup.AddPermission(WmsPermissions.Default, L($"Permission:{WmsPermissions.Default}"));
        InventoryManagement.AddChild(WmsPermissions.Create, L($"Permission:{WmsPermissions.Create}"));
        InventoryManagement.AddChild(WmsPermissions.Update, L($"Permission:{WmsPermissions.Update}"));
        InventoryManagement.AddChild(WmsPermissions.Delete, L($"Permission:{WmsPermissions.Delete}"));
        InventoryManagement.AddChild(WmsPermissions.Export, L($"Permission:{WmsPermissions.Export}"));
        InventoryManagement.AddChild(WmsPermissions.Import, L($"Permission:{WmsPermissions.Import}"));

        
    }

    private static LocalizableString L(string name)
    {
        return LocalizableString.Create<ManagerResource>(name);
    }
}
